<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateWithdrawTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('withdraw', function(Blueprint $table)
		{
			$table->increments('id');
			$table->boolean('type')->nullable()->comment('1.系统添加2.用户申请');
			$table->decimal('price', 9)->default(0.00)->comment('金额');
			$table->string('username')->nullable();
			$table->string('bank_id')->nullable();
			$table->integer('member_id')->unsigned()->nullable()->index('member_id');
			$table->boolean('status')->default(1)->comment('1.待审批 2.已审批3.已拒绝 4.已打款 5.小额自动打款');
			$table->text('refuse_reason', 65535)->nullable();
			$table->text('desc', 65535)->nullable();
			$table->dateTime('apply_time')->nullable()->comment('申请时间');
			$table->dateTime('approve_time')->nullable()->comment('审批时间');
			$table->dateTime('pay_time')->nullable()->comment('汇款时间');
			$table->dateTime('refuse_time')->nullable()->comment('拒绝时间');
			$table->string('status_text', 100)->nullable();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('withdraw');
	}

}
